package org.csu.demo.db.service;

import org.csu.demo.db.domain.Course;
import org.csu.demo.db.persistence.CourseMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Optional;

@Service
public class CourseServiceImpl implements CourseService {
    @Autowired
    private CourseMapper courseMapper;

    @Override
    public Optional<Course> getCourseByCoursename(String coursename) {
        return Optional.ofNullable(courseMapper.selectByCoursename(coursename));
    }
}